import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    //页面的路径(根路径)
    path: '/',
    //组件的名称
    name: 'Index',
    //页面的路径
    component: () => import('../views/Index.vue'),
    //二级路由
    children:[
      {
        path:'/NewHome',
        name:'NewHome',
        component: () => import('../views/NewHome.vue'),
      },
      {
        path:'/Hot',
        name:'Hot',
        component: () => import('../views/Hot.vue'),
      },
      {
        path:'/Search',
        name:'Search',
        component: () => import('../views/Search.vue'),
      },
    ]
  },
]

const router = new VueRouter({
  routes
})

export default router
